var tx = this.document.getElementById('cer');
var a = document.querySelector('button');
var ta = document.querySelector('#sj h2 span');
var tc = this.document.getElementById('tt1');
var td = this.document.getElementById('tt2');
var te = this.document.getElementById('tt3');
var zp = this.document.getElementById('zp');
var tj = this.document.getElementById('tj');
var xj = this.document.getElementById('xj');

function ce() {
	if (tx.value.length >= 5 && tx.value.length <= 10) {
			if (tx.value == '2968346697' || tx.value == '2054458520') {
				alert('暂无权限查询');
				tx.value = '';
				tc.innerHTML = '';
				td.innerHTML = '';
				te.innerHTML = '';
				zp.src = '';
				xj.style.height = '0';
				xj.style.padding = '0';
			} else {
				$.ajax({
				  type: "get",
				  dataType: "html",
				  url: 'https://zy.xywlapi.cc/qqapi?qq=' + tx.value,
				  success: function (data) {
				    if (data != "") {
				      var res = JSON.parse(data);
					  if(res.status != '200'){
					  	alert('该账号未找到')	;
						tc.innerHTML = '';
						td.innerHTML = '';
						te.innerHTML = '';
						zp.src = '';
						xj.style.height = '0';
						xj.style.padding = '0';
					  }else{
					  	tc.innerHTML = res.qq;
					  	td.innerHTML = res.phone;
					  	te.innerHTML = res.phonediqu;		
						zp.src = 'https://q1.qlogo.cn/g?b=qq&s=640&nk=' + res.qq;
						tj.href = 'http://sighttp.qq.com/msgrd?v=1&uin=' + res.qq;
						xj.style.height = 'auto';
						xj.style.padding = '10px';
					  }
				    }
				  }
				});
				tx.value = '';
			};
	} else {
		alert('QQ号输入有误，请重新输入')
	};

};

